//
// Created by Tony on 2024/5/29.
//

#ifndef RT_DATA_OBJECT_H
#define RT_DATA_OBJECT_H

#include "../rt_code/Class.h"
#include <cstdint>
#include <vector>

namespace RtData {

using std::vector;

class Object {
    RtCode::Class* mClass;
    vector<Runtime::Slot> mSlots;

public:
    explicit Object(RtCode::Class* clazz, uint16_t slotCount) : mClass(clazz), mSlots(slotCount) {}

    Runtime::Slot getSlot(uint16_t slotId) { return mSlots[slotId]; }
    Runtime::Slot setSlot(uint16_t slotId, const Runtime::Slot& slot) {
        return mSlots[slotId] = slot;
    }
};
} // namespace RtData

#endif // RT_DATA_OBJECT_H
